<template lang="pug">
  kalix-dialog.user-add(title='查看' bizKey="Note" ref="kalixBizDialog"  v-bind:formModel.sync="formModel" isView)
    div.el-form(slot="dialogFormSlot")
      template(slot="tableColumnSlot")
      el-form-item.short(label="用户名称" prop="userName" v-bind:label-width="labelWidth")
        el-input(v-model="formModel.userName" readonly)
      el-form-item(label="笔记标题" prop="noteTitle" v-bind:label-width="labelWidth" )
        el-input(v-model="formModel.noteTitle" readonly)
      el-form-item(label="笔记详情" prop="noteContent" v-bind:label-width="labelWidth" )
        el-input(v-model="formModel.noteContent" type="textarea" readonly)
      el-form-item(label="笔记日期" prop="creationDate" v-bind:label-width="labelWidth" )
        el-input(v-model="formModel.creationDate" readonly)
          template(slot-scope="scope")
            span {{dataFormat(scope.row.creationDate)}}
      <!--el-table-column(prop="noteEnclosure" label="笔记附件")-->
        <!--template(slot-scope="scope")-->
          <!--div(v-for="img in getArray(scope.row.noteEnclosure)")-->
            <!--img(v-bind:src="img" width="60" height="60" alt="" style="float:left; margin-right: 8px")-->
      el-form-item(label="笔记附件" prop="noteEnclosure" v-bind:label-width="labelWidth")
      kalix-img-upload.img-margin(v-model="formModel.noteEnclosure" readonly="readonly")
      el-form-item(label="笔记点赞数量" prop="noteUpcounts" v-bind:label-width="labelWidth" )
        el-input(v-model="formModel.noteUpcounts" readonly)



</template>

<script type="text/ecmascript-6">
  import FormModel from './model'
  import KalixClansmanUpload from '../../../../../components/fileUpload/upload'
  import {baseURL} from '../../../../../config/global.toml'
  import KalixSelect from '../../../../../components/corelib/components/common/baseSelect'
  import KalixImgUpload from '../../../../../components/corelib/components/common/imgUpload'
  export default {
    name: 'noteView',
    components: {
      KalixSelect,
      KalixClansmanUpload,
      KalixImgUpload
    },
    data() {
      return {
        action: baseURL + '/camel/rest/upload',
        formModel: Object.assign({}, FormModel),
        labelWidth: '120px'
      }
    },
    methods: {
      dataFormat(val) {
        let d = new Date(val)
        return this.$M_FormatDate(d, 'yyyy-MM-dd')
      },

      getArray(val) {
        return val.split(',')
      },
      init(dialogOption) {
        console.log('---------dialogOption------------', dialogOption)
      },
      getFilePath(filePath, fileName) {
        console.log('--getFilePath---', filePath)
        console.log('--fileName---', fileName)

        this.formModel.noteEnclosure = filePath
        this.formModel.imgName = fileName
      }
    }
  }
</script>

<style scoped lang="stylus" type="text/stylus">
  .el-form
    width 50%
    margin auto
    .radio
      margin-left 150px
      margin-bottom 20px
      .el-radio
        color: #3465cb
        font-weight: bold
        font-size: 14px
  .img-margin
    margin-left 150px
</style>
